import { defineStore } from 'pinia';
import {ref} from 'vue'
export const useStore=defineStore('admin',()=>{
    const token=ref('')
    const studentList=ref([])
    const teacherList=ref([])
    const assistantList=ref([])
    const courseList=ref([])
    const classList=ref([])
    const createClass=ref([])
    const attendClass=ref([])
    const attendClassOfStu=ref([])
    const allStudentInClass=ref([])
    const allTeacherInClass=ref([])
    //查看詳情
    const detailStudent=ref({})
    const detailTeacher=ref({})
    const detailClass=ref({})
    const setToken=(data)=>{
        token.value=data
    }
    const setTeacherList=(data)=>{
        teacherList.value=data
    }
    const setStudentList=(data)=>{
        studentList.value=data
    }
    const setCourseList=(data)=>{
        courseList.value=data
    }
    const setClassList=(data)=>{
        classList.value=data
    }
    const setAssistantList=(data)=>{
        assistantList.value=data
    }
    const setCreateClass=(data)=>{
        createClass.value=data
    }
    const setAttendClass=(data)=>{
        attendClass.value=data
    }
    const setAttendClassOfStu=(data)=>{
        attendClassOfStu.value=data
    }
    const setAllStudentInClass=(data)=>{
        allStudentInClass.value=data
    }
    const setAllTeacherInClass=(data)=>{
        allTeacherInClass.value=data
    }
    const setDetailStudent=(data)=>{
        detailStudent.value=data
    }
    const setDetailTeacher=(data)=>{
        detailTeacher.value=data
    }
    const setDetailClass=(data)=>{
        detailClass.value=data
    }
    return{
        teacherList,setTeacherList,
        token,setToken,
        studentList,setStudentList,
        courseList,setCourseList,
        classList,setClassList,
        assistantList,setAssistantList,
        createClass,setCreateClass,
        attendClass,setAttendClass,
        attendClassOfStu,setAttendClassOfStu,
        allStudentInClass,setAllStudentInClass,
        allTeacherInClass,setAllTeacherInClass,
        detailStudent,setDetailStudent,
        detailTeacher,setDetailTeacher,
        detailClass,setDetailClass
    }

},{
    persist:true
});